package com.example.idea_spring_boot.controller;

import com.example.idea_spring_boot.entity.AliPay;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.HashMap;
import java.util.Map;

/**
 * @author C-Q
 * @version 1.1.0
 * @Description: TODO
 * @date 2022/11/15
 */
@RestController
public class TestController {
    @GetMapping("/tes")
    public Map<String,Object> tes(){
        Map<String, Object> map=new HashMap<>();
        map.put("张三",18);
        map.put("list",25);
        return map;
    }
        @Autowired
        private AliPay aliPay;
        @GetMapping("index")
        public AliPay index(){
            return aliPay;
        }

        @Value("${server.port}")
        private Integer port;
        @Value("${student.name}")
        private String name;
        @Value("${students.sname}")
        private String sname;
        @GetMapping("info")
        public String info(){
            return "服务器的端口号"+port+";姓名"+name+";姓名1"+sname;
        }
}




















































